<HTML><HEAD><TITLE>EplexInstance:eplex_get_iis(-NumConstraints, -NumVars, -ConstraintIdxs, -VarInfos)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(eplex)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>EplexInstance:eplex_get_iis(-NumConstraints, -NumVars, -ConstraintIdxs, -VarInfos)</H1>
Returns an IIS for an infeasible problem associated with EplexInstance.
<DL>
<DT><EM>NumConstraints</EM></DT>
<DD>Number of constraints in the IIS
</DD>
<DT><EM>NumVars</EM></DT>
<DD>Number of variables in the IIS
</DD>
<DT><EM>ConstraintIdxs</EM></DT>
<DD>List of Indexes of the constraints in the IIS
</DD>
<DT><EM>VarInfos</EM></DT>
<DD>List of Variable:Status pairs where Variables are the variables in the IIS and Status is the status of that variable
</DD>
</DL>
<H2>Description</H2>
    <P>
    If the solver found that the problem was infeasible, this predicate
    will return an IIS (Irreducible Infeasible Subsystem or Irreducible
    Inconsistent Subsystem) for the problem, if supported by the solver. 
    An IIS is a subset of the problem constraints and variables which
    defines an infeasible subproblem. It is usually irreducible in that
    any proper subset of the IIS is feasible. Finding an IIS allows the
    diagnostic analysis of the infeasible problem. Note that a problem
    may have more than one infeasibility, and thus more than one IIS, 
    but this predicate only returns one. 
    </P><P>
    NumConstraints and NumVars are the number of constraints and variables
    that are in the IIS. ConstraintIdxs is a list of the constraint indexes
    of the constraints in the IIS, these indexes are the indexes that are
    returned by lp_add_constraints/4 and lp_add_cutpool_constraints/4, and can 
    also be used to retrieve the constraint with the constraints_norm(Indexes)
    and constraints(Indexes) options of eplex_get/2 and lp_get/3. VarInfos gives
    information for the variables in the IIS, and is a list of Var:Status
    pair, where Var is a variable in the IIS, and Status is its status.
    Status is a one character string, and can be:
<DL>
       <DT>"b": <DD>if both bounds of the variable are involved in the infeasibility
       <DT>"u": <DD>if the upper bound of the variable is involved in the infeasibility
       <DT>"l": <DD>if the lower bound of the variable is involved in the infeasibility
       <DT>"x": <DD>if it is unknown which bound is involved in the infeasibility
</DL><P>
    An IIS is returned only if finding IIS is supported by the external
    solver. In addition, the solver may limit the type of problems and the
    information returned by the IIS, for example, finding an IIS may be
    limited to linear problems, and/or bound status information may be
    unavailable for the variables (hence the need for the "x" status).
    Consult the manual entry for infeasibility analyses for more detail.   
</P><P>
    The current solver state must be infeasible when this predicate is called
    to obtain the IIS. However, the default behaviour is to fail when the 
    solver determines the problem to be infeasible. Therefore, this
    predicate must be called inside a user-defined infeasible handler, which
    can be defined during solver setup, or with eplex_set/2 or lp_set/3 after
    solver setup. 
</P><P>
    The IIS can only be obtained from the external solver before any change is
    made to the problem in the external solver. Unfortunately, certain
    eplex functionality does change the problem soon after solving the
    problem, before the user have any chance to obtain the IIS information,
    e.g. cutpool constraints or probing -- in the case of the cutpool constraints,
    the removal of the active cutpool constraints, and in the case of probing,
    To get around this problem, the cache_iis option can be used to
    instruct eplex to obtain the IIS information whenever the problem is
    determined to be infeasible, and this information is then cached by the
    eplex instance, so that when the user request the IIS information, it can
    be obtained from the cache.
</P><P>
    For some external solvers, and for problems on the boundary between
    feasible and infeasible, it is possible that the routine that finds
    the IIS will conclude that the problem is feasible, even though it was
    considered infeasible when the problem was solved. In such cases, an
    empty IIS will be returned.

<H3>Exceptions</H3>
<DL>
<DT><EM>(141) unimplemented functionality </EM>
<DD>External solver does not support finding IIS
<DT><EM>(213) Error in external function </EM>
<DD>Error in external solver while getting IIS
</DL>
<H2>Examples</H2>
<PRE>
 % simple inconsistency, get the constraints with constraints option of eplex_get/2
 [eclipse 6]: eplex:(X=:=Y),
        eplex:(X+Y&gt;=3),
        eplex:(X+Y=&lt;2),
        eplex_solver_setup(min(X)),
        eplex_set(infeasible_handler,
             eplex_get_iis(NC,BV, Is, Vs),
             eplex_get(constraints(Is), Cs))),
        eplex_solve(C).
  CPLEX Error  1217: No solution exists.
 
  X = X{-1e+20 .. 1e+20}
  Y = Y{-1e+20 .. 1e+20}
  NC = 2
  BV = 0
  Is = [0, 1]
  Vs = []
  Cs = [X{-1e+20 .. 1e+20} + Y{-1e+20 .. 1e+20} =&lt; 2.0, X + Y &gt;= 3.0]
  C = C
  Yes (0.00s cpu)
  [eclipse 7]:

  % simple example using cutpool constraints and cache_iis option
  [eclipse 7]:         eplex:(X=:=Y), eplex_solver_setup(min(X)),
        eplex_set(cache_iis, yes), eplex_set(infeasible_handler, eplex_get_iis(NC,NV,Is,Vs)),
        eplex_get(handle, H),
        lp_add_cutpool_constraints(H, [(X+Y&gt;=4),(2*X =:= 2*Y), (X+Y=&lt;3)], [], Idxs),
        eplex_solve(C).
  
                                CPLEX Error  1217: No solution exists.
 
  X = X{-1e+20 .. 1e+20}
  Y = Y{-1e+20 .. 1e+20}
  NC = 2
  NV = 0
  Is = [g(2, 0), g(2, 2)]
  Vs = []
  H = lp_handle(0)
  Idxs = [g(2, 0), g(2, 1), g(2, 2)]
  C = C
  Yes (0.00s cpu)
  [eclipse 8]:
  </PRE>
<H2>See Also</H2>
<A HREF="../../lib/eplex/lp_get_iis-5.html">lp_get_iis / 5</A>, <A HREF="../../lib/eplex/eplex_solver_setup-4.html">eplex_solver_setup / 4</A>, <A HREF="../../lib/eplex/eplex_solve-1.html">eplex_solve / 1</A>, <A HREF="../../lib/eplex/eplex_probe-2.html">eplex_probe / 2</A>, <A HREF="../../lib/eplex/eplex_get-2.html">eplex_get / 2</A>, <A HREF="../../lib/eplex/eplex_set-2.html">eplex_set / 2</A>, <A HREF="../../lib/eplex/lp_add_constraints-4.html">lp_add_constraints / 4</A>, <A HREF="../../lib/eplex/lp_add_cutpool_constraints-4.html">lp_add_cutpool_constraints / 4</A>
</BODY></HTML>
